<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>user</title>
    <link rel="stylesheet" th:href="@{/css/bootstrap.css}"></link>
    <script type="text/javascript" th:src="@{/js/My97DatePicker/WdatePicker.js}"></script>
    <script type="text/javascript" src="/js/My97DatePicker/lang/zh-cn.js"></script>
</head>
<body class="container">
<br/>
<h1>修改账单</h1>
<br/><br/>
<div class="with:80%">
	<!-- TODO  回显数据 --> 
    <form class="form-horizontal" action="/bill/update" method="post">
        <input name="billId" th:value="${bill.billId}" style="display: none">
        <div class="form-group">
            <label for="typeId" class="col-sm-2 control-label">类型</label>
            <div class="col-sm-10">
                <select name="typeId" id="typeId" class="form-control">
                    <option value="">全部</option>
                    <option th:each="t:${billTypes}" th:value="${t.typeId}"
                            th:text="${t.typeName}"
                            th:selected="(${bill.typeId} == ${t.typeId})"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label for="title" class="col-sm-2 control-label" >标题</label>
            <div class="col-sm-10">
                <input type="text" class="form-control"
                       name="title" id="title"
                       placeholder="标题"
                       th:value="${bill.title}"
                />
            </div>
        </div>
        <div class="form-group">
            <label for="createTime" class="col-sm-2 control-label">日期</label>
            <div class="col-sm-10">
                <input type="text" class="form-control"
                       name="createTime"  id="createTime"
                       placeholder="日期"
                       onclick="WdatePicker()"
                       th:value="${bill.createTime} ? ${#dates.format(bill.createTime, 'yyyy-MM-dd')}"
                />
            </div>
        </div>
        <div class="form-group">
            <label for="price" class="col-sm-2 control-label">金额</label>
            <div class="col-sm-10">
                <input type="text" class="form-control"
                       name="price"  id="price"
                       placeholder="金额"
                       th:value="${bill.price}"
                />
            </div>
        </div>
        <div class="form-group">
            <label for="explanation" class="col-sm-2 control-label">说明</label>
            <div class="col-sm-10">
                <input type="text" class="form-control"
                       ame="explanation" id="explanation"
                       placeholder="说明"
                       th:value="${bill.explanation}"
                />
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <input type="submit" value="保存" class="btn btn-info" />
                &nbsp; &nbsp; &nbsp;
                <input type="reset" value="重置" class="btn btn-info" />
            </div>

        </div>
    </form>
</div>
</body>
</html>
